// flex布局
@mixin flex($direction: row, $justify: flex-start, $align: center) {
    display: flex;
    flex-direction: $direction;
    justify-content: $justify;
    align-items: $align;
}

// 文本省略
@mixin ellipsis($lines: 1) {
    @if $lines ==1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    @else {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: $lines;
        overflow: hidden;
    }
}

// 阴影
@mixin box-shadow($level: 1) {
    @if $level ==1 {
        box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
    }

    @else if $level ==2 {
        box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
    }

    @else if $level ==3 {
        box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.15);
    }
}